const Mock = require("mockjs");

const Random = Mock.Random;

module.exports = [
  {
    //获取用户信息
    url: "/api/user/info",
    method: "get",
    response() {
      return {
        errno: 0,
        data: {
          username: Random.name(),
          nickname: Random.cname(),
        },
      };
    },
  },
  {
    //注册
    url: "/api/user/register",
    method: "post",
    response() {
      return {
        errno: 0,
      };
    },
  },
  {
    //登录
    url: "/api/user/login",
    method: "post",
    response() {
      return {
        errno: 0,
        data: {
          token: Random.word(20),
        },
      };
    },
  },
  {
    //接受前端图片返回url
    url: "/api/user/upload",
    method: "post",
    response() {
      return {
        errno: 0,
        data: {
          url: "http://image.zclstrive.top/app/thumb.php?img=/i/2023/07/25/h0zvxh.png",
        },
      };
    },
  },
];
